package com.vchello.bean.file;

import java.io.Serializable;
import java.util.List;
import java.util.Set;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

/**
 * 
 * @author power 文件夹
 */
@TableName("folder")
public class Folder extends Model<Folder> {

	private static final long serialVersionUID = 1L;

	@TableId("id")
	private int id;

	@TableField("name")
	private String name;

	@TableField("user_id")
	private int userId;

	@TableField("pro_id")
	private int proId; // 如果是项目文件夹就对应项目ID不是就为0

	@TableField("parent_id")
	private int parentId; // 如果为二级文件夹就对应一级Id，不是就为0

	@TableField("create_time")
	private String createTime;

	@TableField(exist = false)
	private Set<Folder> childrenList;

	@TableField(exist = false)
	private List<File> fileList;

	@TableField(exist = false)
	private Folder fatherFolder;
	
	private int type;   //1有二级文件夹查询(项目文件) 2其他文件

	public Folder() {
	}
	
	public Folder(int userId) {
		super();
		this.userId = userId;
	}

	public Folder(String name, int userId, int proId, int parentId, String createTime) {
		super();
		this.name = name;
		this.userId = userId;
		this.proId = proId;
		this.parentId = parentId;
		this.createTime = createTime;
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getUserId() {
		return userId;
	}

	public void setUserId(int userId) {
		this.userId = userId;
	}

	public int getProId() {
		return proId;
	}

	public void setProId(int proId) {
		this.proId = proId;
	}

	public int getParentId() {
		return parentId;
	}

	public void setParentId(int parentId) {
		this.parentId = parentId;
	}

	public String getCreateTime() {
		return createTime;
	}

	public void setCreateTime(String createTime) {
		this.createTime = createTime;
	}

	public Set<Folder> getChildrenList() {
		return childrenList;
	}

	public void setChildrenList(Set<Folder> childrenList) {
		this.childrenList = childrenList;
	}

	public List<File> getFileList() {
		return fileList;
	}

	public void setFileList(List<File> fileList) {
		this.fileList = fileList;
	}

	public Folder getFatherFolder() {
		return fatherFolder;
	}

	public void setFatherFolder(Folder fatherFolder) {
		this.fatherFolder = fatherFolder;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	protected Serializable pkVal() {
		return this.id;
	}
}